{config_load file="$language/lang.conf" section="account"}
{if $error!=''}
	<div class="notification error br6 png_bg">
		<a href="#" class="close">close</a>
		<div>{$error_message}</div>
	</div>
{/if}

{if $LINK_LOGIN}
	<div class="notification information br6 png_bg">
		<a href="#" class="close">close</a>
		<div><a href="{$LINK_LOGIN}">{#text_login#}</a></div>
	</div>
{else}
<div class="lrbox">
	<div class="lbox">
		<div class="content-block">
			<div class="gray-title-top">
				<div class="b-left"></div>
					<span class="bold tsb">{#title_welcome#}</span>
				<div class="b-right"></div>
			</div>
			<div class="con-cen">
				<div class="content-text">
					{#text_welcome#}
				</div>
			</div>
			<div class="con-foo"><div class="sb-left"></div><div class="sb-right"></div></div>
		</div>
	</div>
	<div class="rbox">
		<div class="content-block">
			<div class="gray-title-top">
				<div class="b-left"></div>
					<span class="bold tsb">{#title_account#}</span>
				<div class="b-right"></div>
			</div>
			<div class="con-cen">
				<div class="content-text">
				<ul class="account-menu">
					<li>&raquo; <a href="{$LINK_EDIT}">{#text_edit#}</a></li>
					<li>&raquo; <a href="{$LINK_ADDRESS}">{#text_address#}</a></li>
					<li>&raquo; <a href="{$LINK_PASSWORD}">{#text_password#}</a></li>
					<li>&raquo; <a href="{$LINK_NEWSLETTER}">{#text_newsletter#}</a></li>
				</ul>
				</div>
			</div>
			<div class="con-foo"><div class="sb-left"></div><div class="sb-right"></div></div>
		</div>
	</div>
	<div class="clear"></div>
</div>

{if $order_content}
<div class="content-block">
	<div class="gray-title-top">
		<div class="b-left"></div>
			<span class="bold tsb">{#title_orders#} <a href="{$LINK_ALL}">{#text_all#}</a></span>
		<div class="b-right"></div>
	</div>
	<div class="con-cen">
		<div class="content-text">
			{foreach name=aussen item=order_data from=$order_content}
			<div class="account-orders {if $smarty.foreach.aussen.iteration % 2 == 1}lbox{else}rbox{/if}">
				<p><span class="bold">{#templatica_account_order_date#}</span> <a href="{$order_data.ORDER_LINK}">{$order_data.ORDER_DATE}</a></p>
				<p><span class="bold">{#order_nr#}</span> {$order_data.ORDER_ID}</p>
				<p><span class="bold">{#order_status#}</span> {$order_data.ORDER_STATUS}</p>
				<p><span class="bold">{#order_total#}</span> {$order_data.ORDER_TOTAL}</p>
				<p>{$order_data.ORDER_BUTTON}</p>
				<div class="clear"></div>
			</div>
			{/foreach}
		</div>
	</div>
	<div class="con-foo"><div class="sb-left"></div><div class="sb-right"></div></div>
</div>
{/if}

{if $products_history}
<div class="content-block">
	<div class="gray-title-top">
		<div class="b-left"></div>
			<span class="bold tsb">{#title_viewed_products#}</span>
		<div class="b-right"></div>
	</div>
	<div class="con-cen">
		<div class="con-cen-cen">
		<!-- Две колонки -->
		{foreach name=history_products item=products_history from=$products_history}
		{php}$col++;{/php}
		<div class="prod-two-col {if $smarty.foreach.history_products.iteration % 2 == 1}{else}border-left{/if}">
			{if $products_history.PRODUCTS_IMAGE}<a href="{$products_history.PRODUCTS_LINK}" title="{$products_history.PRODUCTS_NAME}"><img class="prod-img" src="{$products_history.PRODUCTS_IMAGE}" alt="{$products_history.PRODUCTS_NAME}" /></a>{/if}
			<ul class="prod-info">
				<li class="name bold"><a href="{$products_history.PRODUCTS_LINK}">{$products_history.PRODUCTS_NAME}</a></li>
				{if $products_history.PRODUCTS_SHORT_DESCRIPTION}
				<li class="desc">{$products_history.PRODUCTS_SHORT_DESCRIPTION|os_truncate:200}</li>
				{/if}
				<li>{if $products_history.PRODUCTS_VPE}{$products_history.PRODUCTS_VPE}<br />{/if}{$products_history.PRODUCTS_TAX_INFO}{$products_history.PRODUCTS_SHIPPING_LINK}</li>
				<li class="buy"><span class="cost bold"><em>{$products_history.PRODUCTS_PRICE}</em></span> {$products_history.PRODUCTS_BUTTON_BUY_NOW_NEW}</li>
				<li><a href="{$products_history.PRODUCTS_CATEGORY_URL}">{#text_goto_cat#}</a></li>
			</ul>
			<div class="clear"></div>
		</div>
{if $smarty.foreach.history_products.iteration+2 gt $smarty.foreach.history_products.total}
		{php}
			// Определям сколько колонок будет на странице
			if ($col>=2) {
				$col=0;
				echo '<div class="clear"></div>';
			}
		{/php}
{else}
		{php}
			// Определям сколько колонок будет на странице
			if ($col>=2) {
				$col=0;
				echo '<div class="clear sep"></div>';
			}
		{/php}
{/if}
		{/foreach}
		<!-- #Две колонки -->
		</div>
	</div>
	<div class="con-foo"><div class="sb-left"></div><div class="sb-right"></div></div>
</div>
{/if}
{/if}